Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #20287: Add flexible types to Quotes library #20293

Merged
merged 2 commits into from
May 6, 2024

Conversation

noti0na1
Copy link
Member

@noti0na1 noti0na1 commented Apr 29, 2024

Fix #20287

To fix the missing case, we have to add flexible types to Quotes library.

library/src/scala/quoted/Quotes.scala Show resolved Hide resolved
@noti0na1
Copy link
Member Author

Hi @nicolasstucki, do you have any idea why the extractor for FlexibleType does not work in Extractors.scala and SourceCode.scala: TypeRepr is not a valid result type of an unapply method of an extractor.

@noti0na1 noti0na1 self-assigned this Apr 29, 2024
@noti0na1 noti0na1 added the needs-minor-release This PR cannot be merged until the next minor release label Apr 29, 2024
@noti0na1 noti0na1 marked this pull request as ready for review April 29, 2024 23:29
@nicolasstucki
Copy link
Contributor

This should probably be included in 3.5 as it is a part of #18112. Specifically, the changes in the TASTy format require this change in the reflection API.

@sjrd
Copy link
Member

sjrd commented May 1, 2024

The core meeting decided to take this PR in on 3.5.0.

Copy link
Contributor

@jchyb jchyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The only thing missing here is the scaladoc for FlexibleTypeMethods, but this can be done in a separate PR, and with another review cycle we may not meet the deadline today for the cutoff for 3.5.0

@jchyb jchyb dismissed nicolasstucki’s stale review May 6, 2024 09:00

Nicolas is unavailable and all of the changes and concerns raised by him were resolved.

Copy link
Member

@hamzaremmal hamzaremmal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from some observations, LGTM

ConstantType(StringConstant("hello"))

Inlined(None, Nil, Apply(Select(Literal(StringConstant("world")), "trim"), Nil))
FlexibleType(TypeRef(ThisType(TypeRef(NoPrefix(), "lang")), "String"))
Copy link
Member

@hamzaremmal hamzaremmal May 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmmh, I'm wondering why we don't have the java prefix here for java.lang.String.


We do have it for the second type below 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess because it is from a Java method?

@noti0na1 noti0na1 merged commit 6af2bcf into scala:main May 6, 2024
19 checks passed
@noti0na1 noti0na1 deleted the fix-20287 branch May 6, 2024 15:39
@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-minor-release This PR cannot be merged until the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FlexibleTypes are not handled in Quotes
6 participants